<?php
//http://localhost/1908php3/cargoodsnum.php?userid=23
@include_once("toubu.php");
$userid = $_GET["userid"];
$sql  = "select  sum(goodsnum) from  guccicar where  userid = $userid";
$result  = mysql_query($sql);//id是主键  是唯一的
$item= mysql_fetch_array($result);
$obj=array();
$obj["num"]=$item["0"];
echo json_encode($obj);
?>